<template>
    <!-- 统计和清空  当任务数为0时，不显示-->
    <footer>
        <span>合计：{{ list.length }}</span>
        <button @click="del_all">清空任务</button>
    </footer>
</template>

<script>
export default {
    props:{
        list:Array
    },
    methods:{
        del_all(){
            // console.log('all1')
            this.$emit('clearAll')
        }
    }
}
</script>

<style scoped>
    footer{
        background-color: #ffd;
        position: relative;
        margin-top: -20px;
    }
    span{
        position: absolute;
        left: 10px;
    }
    button{
        background-color: #aab;
        border: none;
        position: absolute;
        right: 20px;
    } 
</style>